<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/base.js"></script>
    <style>
        *{
            padding:0px;
            margin:0px;
        }
        body{
            height:2000px;
            background: red;
        }
    </style>
</head>
<body>
    <script>
        //document.documentElement.scrollHeight 文档的高度
        //documentElement.scrollTop 话条距离顶部的高度
        //document.documentElement.clientHeight 可视区的高度
        // Math.ceil()上取整
        //Math.floor()下取整
        //Math.round()四舍五入取整
       /*  var scrollHeight=document.documentElement.scrollHeight;
        console.log(scrollHeight);
        window.onscroll=function(){
            var scrollTop=Math.ceil(document.documentElement.scrollTop);
            console.log(scrollTop);
            var clentHeight=document.documentElement.clientHeight;
            console.log(clentHeight);
            if((scrollTop+clentHeight)>=(scrollHeight)){
                console.log("到底底部")
            }
        } */
        window.onscroll=function(){
            console.log( onReachBottom())
        }
    
    </script>
</body>
</html>